package com.oe.context;

public class UserContext {

    public static final String USER_KEY="USER";

    ThreadLocal<UserInfo> threadLocal=new ThreadLocal<UserInfo>();


    public static UserContext userContext;

    static {
        userContext=new UserContext();
    }

    private UserContext(){};


    public static UserContext getContext(){
        return userContext;
    }


    public UserInfo getCurrUser(){
        return threadLocal.get();
    }


    public void setCurrUser(String username,String userId,String accessIp){
        threadLocal.set(new UserInfo(username,userId,accessIp));
    }





}
